#pragma once

#include "SpriteText.h"
#include "List.h"
#include <iostream>
#include <iomanip>

// image path
#define BG_PATH "bg.png"
#define BG_APPLAUDE_PATH "bg2.png"
#define BG_MILEAGE_PATH "Mileage.png"
#define BG_FONT_PATH "PressStart2P.ttf"

// size
#define BG_WIDTH 1024
#define BG_HEIGHT 896
#define BG_MILEAGE_W 172
#define BG_MILEAGE_H 76
#define BG_FONT_SIZE 32

// starting position
#define BG_START_X 0
#define BG_START_Y 0
#define BG_MILEAGE_OFFSET_X 804
#define BG_MILEAGE_OFFSET_Y 808
#define BG_MILEAGE_TEXT_OFFSET_X 20
#define BG_MILEAGE_TEXT_OFFSET_Y 22

// gameplay
#define MILEAGE_TO_FINISH 8000
#define DEFAULT_MILEAGE_DISPLAY "000"
#define MILEAGE_TEXT_FILLER '0'
#define MILEAGE_TEXT_WIDTH 3
#define METERS_PER_TILE 10

class Background {
private: 
	bool isHorz;
	Sprite *left;
	Sprite *right;
	int mileage;
	int end;
	Sprite *leftMileage;
	Sprite *rightMileage;
	SpriteText *leftMileageDisplay;
	SpriteText *rightMileageDisplay;
	void ResetPos();
	void DisplayMilage();
public: 
	Background();
	Background(bool);
	Background(const std::string &);
	Background(const std::string &, bool);
	~Background();
	void ScrollBy(int);
	void Reset();
	int GetMileage() { return mileage; }
	Sprite *GetLeft() { return left; }
	Sprite *GetRight() { return right; }
};

